multiple SWF files into one HTML page

1,079 views
Skip to first unread message

skynarc

unread,
Oct 7, 2009, 5:53:33 AM10/7/09
to SWFObject
I have stripped my example down to the bare bones to show multiple swf
files on one HTML page using swfobject and I am now convinced there is
an issue with Firefox 3.x

I have followed all the steps, used the generator and generally tried
everything short of trimming the queen's pubic hair with nail clipper!

If someone has an answer and some examples, I would appreciate the
help.

Thanks!

Philip Hutchison

unread,
Oct 7, 2009, 1:00:53 PM10/7/09
to swfo...@googlegroups.com
bobby has examples for embedding multiple SWFs here:

http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/

James

unread,
Oct 7, 2009, 3:57:28 PM10/7/09
to swfo...@googlegroups.com
Hi Philip,

Thanks for sending these test pages onto me.

It seems that I need to embed my swf files like this if I am going to use FlashVars:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript" src="swfobject.js"></script>
        
        <script type="text/javascript">
            swfobject.embedSWF("base.swf", "Header", "100%", "488", "8.0.0", "expressInstall.swf");           
        </script>
                
        <script type="text/javascript">
            swfobject.embedSWF("map.swf", "Map", "350", "350", "8.0.0", "expressInstall.swf", { name1: "hello", name2: "world", name3: "foobar" }, { menu: "false" }, { id: "myDynamicContent", name: "myDynamicContent" });
        </script>
        
    </head>
    <body style="background-color:#000000">
        
        <div id="Header">
            <a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
            </a>
        </div>
        
        
        <div id="Map">
            <a href="http://www.adobe.com/go/getflashplayer">
                <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
            </a>
        </div>
        
        
    </body>
</html>

Is this the case? Is the correct way of embedding multiple swf files if I want to use FlashVars too?

Many thanks!


--
James van der Hoven
082.851.2724

www.sixfoot.co.za

Aran Rhee

unread,
Oct 7, 2009, 6:04:04 PM10/7/09
to swfo...@googlegroups.com
@James. 

Your flashvars don't need to be local to a script block. If you want to set them up globally before your embedSWF() calls, then you can do that too. Also, you don't need seperate script blocks for each embed, they can be combined. e.g 


script type="text/javascript" src="swfobject.js"></script>
        
        <script type="text/javascript">
            var fvars = { name1: "hello", name2: "world", name3: "foobar" }

            swfobject.embedSWF("base.swf", "Header", "100%", "488", "8.0.0", "expressInstall.swf");           
            swfobject.embedSWF("map.swf", "Map", "350", "350", "8.0.0", "expressInstall.swf", fvars , { menu: "false" }, { id: "myDynamicContent", name: "myDynamicContent" });
        </script>


Aran

James

unread,
Oct 8, 2009, 7:40:44 AM10/8/09
to swfo...@googlegroups.com
@Aran

Hi Aran,

Thanks for the tips. I have implemented your steps and w e
have run numerous tests now and it has now come down to either a DNN-SWFObject loading multiple swf files on a page or a Firefox bug.

Here's the outcome we need:

Two swf files on one page:

  • 1. Header.swf: which holds the nav and some bling animation.
  • 2. Map.swf: which has different provinces of the country highlighted on rollover. The active province is highlighted by reading the URL via Javascript and then loaded into the Map.swf via FlashVars.
In all of our other tests in other browsers, the scenario works very well but in Firefox 3.5.3 The swf files refuse to show.

We have stripped this test down to the bare minimum, one html page scenario and embedding it the same way using SWFObject 2.2 and this works in Firefox. When it is uploaded in DNN, the swf files refuse to show.

Could it be that there is a clash of scripts somewhere? And if so, what are the possible steps I can take to debug this?

Many thanks,
James

skynarc

unread,
Oct 8, 2009, 11:16:35 AM10/8/09
to SWFObject
@Aran

Here's a link to the page I am talking about Aran.

Check it in IE, then check it in Firefox so you can see what I mean.

Hope you can help..

http://demo.mrvideo.co.za/Stores.aspx

Thanks,
James

On Oct 8, 1:40 pm, James <ja...@sixfoot.co.za> wrote:
> @Aran
>
> Hi Aran,
>
> Thanks for the tips. I have implemented your steps and w ehave run
> numerous tests now and it has now come down to either a DNN-SWFObject
> loading multiple swf files on a page or a Firefox bug.
>
> Here's the outcome we need:
>
> Two swf files on one page:
>
>     * 1. Header.swf: which holds the nav and some bling animation.
>     * 2. Map.swf: which has different provinces of the country
> >     <http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif>
> >     alt="Get Adobe Flash player" />
> >                 </a>
> >             </div>
>
> >         </body>
> >     </html>
>
> >     Is this the case? Is the correct way of embedding multiple swf
> >     files if I want to use FlashVars too?
>
> >     Many thanks!
>
> >     Philip Hutchison wrote:
> >>     bobby has examples for embedding multiple SWFs here:
>
> >>    http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/
>
> >>     On Wed, Oct 7, 2009 at 2:53 AM, skynarc <ja...@sixfoot.co.za
> >>     <mailto:ja...@sixfoot.co.za>> wrote:
>
> >>         I have stripped my example down to the bare bones to show
> >>         multiple swf
> >>         files on one HTML page using swfobject and I am now convinced
> >>         there is
> >>         an issue with Firefox 3.x
>
> >>         I have followed all the steps, used the generator and
> >>         generally tried
> >>         everything short of trimming the queen's pubic hair with nail
> >>         clipper!
>
> >>         If someone has an answer and some examples, I would
> >>         appreciate the
> >>         help.
>
> >>         Thanks!
>
> >     --
> >     *James van der Hoven*
> >     082.851.2724
>
> >    www.sixfoot.co.za<http://www.sixfoot.co.za>
>
> --
> *James van der Hoven*
> 082.851.2724
>
> www.sixfoot.co.za<http://www.sixfoot.co.za>

Sam Sherlock

unread,
Oct 8, 2009, 12:28:35 PM10/8/09
to swfo...@googlegroups.com
Hi James,

In FF the base swf is not displaying since the target div is after the call to swfobject that places it in the document. Solve this by placing the codeblock after the div (right before the close body -- if you can't palce it in the head of document)

FF can't handle this but it works fine in ie

hth - S


2009/10/8 skynarc <ja...@sixfoot.co.za>

Aran Rhee

unread,
Oct 8, 2009, 5:29:27 PM10/8/09
to swfo...@googlegroups.com
Ideally, all your swfobject code should go into the <head> like you other scripts. As Sam said, if you are put your script block inline, then the target div has to exist before you try write to it as HTML code gets parsed in order of apperance on the page.


Aran 

James

unread,
Oct 9, 2009, 4:34:31 AM10/9/09
to swfo...@googlegroups.com
Thanks so much guys! I have embedded Flash a thousand times before and don't ask me how I overlooked that one! :-)
Reply all
Reply to author
Forward
0 new messages